package com.aptemo.webetek.client.exceptions;

import java.io.Serializable;

public class BackendException
		extends Exception implements Serializable
{

	/**
	 * 
	 */
	private static final long	serialVersionUID	= 6913847251089582813L;

	public enum EErrorCodes
	{
		NOT_TEAM_MEMBER, INVALID_ID, NOT_WEBETEK_USER, NOT_TEAM_EDITOR, INVALID_NO_OF_PICKS, BET_DATE_EXCEEDED, WRONG_BET_STATUS, PLAYER_EXISTS_ALREADY, STAKE_BALANCE_EXCEEDED, STAKE_DATE_EXCEEDED, STAKE_WRONG_STATUS, NOT_TEAM_OWNER, DO_NOT_REMOVE_OWNER, WRONG_EMAIL_ADDRESS, CANNOT_SEND_EMAIL, RPC_ERROR, LOGIN_ERROR, STAKE_LIMIT_EXCEEDED, INVALID_OWNER_DATA, SERVER_ERROR, BET_PLACED_ALREADY, NOT_ADMIN, STAKE_BALANCE_WRONG, MISSING_ACTION, WRONG_ODDS_CALCULATIONS
	}

	private EErrorCodes			errorCode;

	protected BackendException()
	{
	}

	public BackendException(EErrorCodes errorCode)
	{
		this(errorCode, errorCode.toString());
	}

	public BackendException(EErrorCodes errorCode, String message)
	{
		super(message);
		this.errorCode = errorCode;
	}

	public EErrorCodes getErrorCode()
	{
		return errorCode;
	}

}
